/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cageballcommon.messages;

import cageballcommon.*;
import java.util.Collection;

/**
 *
 * @author kanonas
 */
public class Team {

    private transient int id;
    private int score;
    private Collection<Player> players;

    public Team() {
    }

    public Team(int id, Collection<Player> players){
        this.id = id;
        this.players = players;
    }

    public Team(int id, int score, Collection<Player> players) {
        this.id = id;
        this.score = score;
        this.players = players;
    }

    public Team(Team team) {
        this(team.getId(), team.getScore(), team.getPlayers());
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public Collection<Player> getPlayers() {
        return players;
    }

    public void setPlayers(Collection<Player> players) {
        this.players = players;
    }

    @Override
    public String toString() {
        StringBuffer buff = new StringBuffer();

        buff.append("id=" + id + "\n");

        for (Player p : players) {
            buff.append(p + "\n");
        }

        return buff.toString();
    }
}
